<?php
/**
* 权限设计
*
*用于控制论文系统的各级权限
*
*  acl值    功能
*	 1          登陆               LOGIN
*    2          发布论文题目       PUBLISH_TITLE
*    4          选择论文题目       SELECT_TITLE
*    8          生成表格     	       CREATE_FORM
*    16          确定教师职称所带人数    TEACHER_STU
*    32         专业管理员签名         ADMIN_AFFIRM
*    64         教师签名               TEACHER_AFFIRM
*    128          发布公告             PUBLISH_NOTICE
*              
*       
*	     
*/
	include "DbClass.php";
	
//	defined('YII_DEBUG') or define('YII_DEBUG',true);
	define('LOGIN','1'); //登陆
	define('PUBLISH_TITLE','2'); //发布论文题目
	define('SELECT_TITLE','4'); //选择论文题目
	define('CREATE_FORM','8'); //生成表格
	define('TEACHER_STU','16'); //确定教师职称所带人数
	define('ADMIN_AFFIRM','32'); //专业管理员签名
	define('TEACHER_AFFIRM','64'); //教师签名
	define('PUBLISH_NOTICE','128'); //发布公告
	
	class power extends db(){
		
		private  $power_number  //权值数
		
		function PowerJuage($power_number){
		
			$this->power_number=$power_number;
			
			if(!($power_number&LOGIN)){       //login
				 
				return 'error1'; 
				 
			}else if(!(!power_number&PUBLISH_TITLE)||!(!power_number&SELECT_TITLE)||!(!power_number&CREATE_FORM)
			
			||!(!power_number&TEACHER_STU)||!(!power_number&ADMIN_AFFIRM)||!(!power_number&TEACHER_AFFIRM)
			
			||!(!power_number&PUBLISH_NOTICE)){
				
				return 'error2';
			}else{
			
				return true;
			}	
		}
	}
?>